package edu.biwu.dao.impl;

import edu.biwu.dao.AccountDao;
import edu.biwu.po.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class AccountDaoImpl implements AccountDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void updateAccount(Account account) {
        jdbcTemplate.update("UPDATE spring.account SET money=money+? WHERE name = ?", account.getMoney(), account.getName());
    }
}
